Skip to content

fix(navbar): preserve locale behind base path - #158

Open
morluto wants to merge 1 commit into
QwenLM:mainfrom
morluto:fix/navbar-basepath-locale
Open

fix(navbar): preserve locale behind base path#158
morluto wants to merge 1 commit into
QwenLM:mainfrom
morluto:fix/navbar-basepath-locale

Conversation

@morluto

@morluto morluto commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

getUserLanguage() reads the first URL segment as the locale. On GitHub Pages, the first segment is the deployment base path (qwen-code-docs), so navbar links can fall back to the browser language instead of preserving the locale in the current route.

For example, a visitor on /qwen-code-docs/fr/... can receive English navbar destinations when their browser language is English.

Changes

  • strip the configured base path before reading the route locale
  • keep browser-language fallback for routes without a locale
  • add focused coverage for production, local, and locale-free paths

Validation

  • cd website && npm test
  • cd website && npx tsc --noEmit --incremental false
  • autoreview against origin/main: clean

Build note

npm run build reaches Next.js compilation but currently fails on public/fonts/JetBrainsMono/JetBrainsMono-Variable.ttf with Unknown font format. That asset failure is present outside this navbar change and is not included here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant